package com.zzxx.shooter;

import java.awt.image.BufferedImage;

public class Bee extends FlyingObject implements Award{
    private int xSpeed;
    private int ySpeed;

    private int type;


    public Bee() {
        image = ShootGame.bee0;
        width = image.getWidth();
        height = image.getHeight();
        xSpeed = 2;
        ySpeed = 2;
        x = (int) (Math.random() * ShootGame.WIDTH)-width;
        y = 0;
        life = 2;
        type = (int) Math.round(Math.random());

        emberImages = new BufferedImage[]{ShootGame.bee_ember0,
                ShootGame.bee_ember1,
                ShootGame.bee_ember2,
                ShootGame.bee_ember3};
    }

    public int getType(){
        return type;
    }

    public int getxSpeed() {
        return xSpeed;
    }

    public void setxSpeed(int xSpeed) {
        this.xSpeed = xSpeed;
    }

    public int getySpeed() {
        return ySpeed;
    }

    public void setySpeed(int ySpeed) {
        this.ySpeed = ySpeed;
    }

    @Override
    public void step() {
        this.y += ySpeed;
        this.x += xSpeed;
        if(x >= 400-width){
            this.xSpeed = -this.xSpeed;
        }else if(x<=0){
            this.xSpeed = -this.xSpeed;
        }
    }
    public boolean outOfBound(){
        return y > 650;
    }


}
